﻿using Microsoft.AspNet.SignalR;
using System.Web;

namespace PushManager.Web
{
    /// <summary>
    /// 测试连接使用的
    /// </summary>
    public class ChatHub : Hub
    {
        public void Send(string name, string message)
        {
            // Call the broadcastMessage method to update clients.
            GlobalHost.ConnectionManager.GetHubContext<ChatHub>()
                .Clients.User("mainForm0001").broadcastMessage("name", Context.ConnectionId);

            Clients.User("mainForm0001").broadcastMessage("name", name);
            Clients.All().broadcastMessage(name, message);
        }
    }
}